<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<LINK href="showAllOrg.files/style.htm" rel=stylesheet>
		<LINK href="showAllOrg.files/content.htm" rel=stylesheet>
	
 <script type="text/javascript">
		    var djConfig = {
				isDebug:true,
				parseOnLoad:true,
				usePlainJson:true
		    };
		</script>
		 
		<script type="text/javascript" src="dojo/dojo/dojo.js"></script>
		<script type="text/javascript" src="dojo/dijit/dijit.js"></script>

		<script type="text/javascript">
    		dojo.require("dijit.form.Button");
    		dojo.require("dojo.rpc.JsonService");    	
    	</script>
    	<script language="JavaScript" type="text/javascript">
    		var orderBoxService = new dojo.rpc.JsonService("box/order/OrderBoxService?smd");
    		var orderPlanImportService = new dojo.rpc.JsonService("box/alloc/OrderPlanImportService?smd");
			var makeShipperNoteService = new dojo.rpc.JsonService("box/order/MakeShipperNoteService?smd");

    		//页面加载时的一些操作
			dojo.addOnLoad(load);
			function load() {
				initPage();
			}
			function initPage() {
				makeShipperNoteService.getOrderPlan().addCallback(function (orderPlan) {
					makeShipperNoteService.getAllocDetails().addCallback(function (ad) {
						makeShipperNoteService.getShipperNote().addCallback(function (sn) {							
							console.dir(orderPlan);
							document.getElementById("sn_id1").innerHTML = sn.id + "批装箱单明细";
							document.getElementById("last_modified_date").innerHTML = showDate();
							document.getElementById("sn_id2").innerHTML = sn.id;
							document.getElementById("init_date").innerHTML = showDate();
							document.getElementById("bl_id").innerHTML = sn.BLInfo.id;
							document.getElementById("scd_id").innerHTML = orderPlan.shipSchedule.id;
							document.getElementById("ship_name").innerHTML = orderPlan.shipSchedule.shipInfo.name;
							document.getElementById("receive_loc").innerHTML = ad.commission.receiveLoc;
							
							document.getElementById("sender").innerHTML = ad.commission.sender.name;
							document.getElementById("receiver").innerHTML = ad.commission.receiver.name;
							document.getElementById("departure").innerHTML = ad.commission.departure;
							document.getElementById("destination1").innerHTML = ad.commission.destination;
							document.getElementById("destination2").innerHTML = ad.commission.destination;
							makeShipperNoteService.getBoxAndGoods(sn.id).addCallback(function (BAG) {
								orderBoxService.getBagId().addCallback(function (bagId) {
									var bag = BAG.list;
									var tbl = document.getElementById("box_and_goods");
									
									for (var i in bag) {
										console.dir(bag[i]);
										if (bag[i].id == bagId) {
											orderBoxService.getContainerLoad(bag[i].box.id).addCallback(function (CL) {
												console.dir(CL);
												document.getElementById("cl_id").innerHTML = CL.id;
												document.getElementById("load_loc").innerHTML = CL.loadLoc;
												document.getElementById("loader_name").innerHTML = CL.loaderName;
												document.getElementById("loader_tel").innerHTML = CL.loaderTel;
												document.getElementById("loader_sign").innerHTML = CL.loaderSign;
												document.getElementById("driver_sign").innerHTML = CL.driverSign;
												document.getElementById("truck_no").innerHTML = CL.truckNo;
											});
											document.getElementById("box_id").innerHTML = bag[i].box.id;
											document.getElementById("box_leadSealing").innerHTML = "";
											document.getElementById("box_type").innerHTML = bag[i].box.type;
											document.getElementById("danger_class").innerHTML = bag[i].goods.dangerClass;
											document.getElementById("unid").innerHTML = bag[i].goods.UNID;
											document.getElementById("goods_type").innerHTML = bag[i].goods.type;
											document.getElementById("goods_temp").innerHTML = bag[i].goods.temp;											
											break;
										}
									}
								});
							});							
						});
					});
				});
			}
			//得到当前日期
			function showDate() {
				var today = new Date();   
				var day = today.getDate();   
				var month = today.getMonth() + 1;   
				var year = today.getFullYear();   
				return year + "-" + month + "-" + day;
			}
			//返回
			function go_back() {
				window.open("装箱单列表.htm", "_self");
			}
			//更新装箱单明细
			function update_container_load() {
				orderBoxService.updateContainerLoad(document.getElementById("cl_id").innerHTML,
						document.getElementById("box_leadSealing").value).addCallback(function (res) {
							alert(res);
							if (res == "更新成功") {
								window.open("更新装箱单.htm", "_self");
							}
						});
			}
    	</script>
    	<title>装箱单明细</title>
</head>
<body>

<font face="隶书" color="3656B9" ; style="font-size: 18px;">装箱单明细</font><br>
<img src="showAllOrg.files/line2.gif"><br>

<center>


	<table width="700" border="0" cellpadding="0" cellspacing="0" >		
     	 <tr height="80">
       <td class="ctitle" ><input id="sn_id1" class ="billtitle" value="10022号装箱单明细" size=40></td>
      </tr>
	</table>

	<table width="760" border="0" cellpadding="0" cellspacing="0" >
    <tr>
    <td	class="ctitle"  >上次更改日期：<input id="last_modified_date" type="text" name="Bill_date" 
    value="2008-01-02"  size=10 class="linputrl"></td>
	    
	
    <td class="ctitle"   >
    第<input id="sn_id2"  type="text" name="Bill_code"  value="10022" size="19" class="linputrl"  >批
    </td>
	
	<td class="rtitle">单据类型：</td>  <td  	class="ltitle"><select name="Bill_type">
			<option value="I" selected="selected">初始化单据</option>
			  </select>        
          </td>
    </tr>
	</table>

	<table  class="titlearea" width="760" border="0" cellpadding="2" cellspacing="1">
      <tr >
			 <td		class="rtitle" width=95>*初始化日期：</td>
			
          <td id="init_date" 	class="ltitle"></td> 
          <td		class="rtitle" width=95>*装箱单编码：</td>
          <td id="cl_id" 	class="ltitle">
          </td>
		  <td		class="rtitle" width=95>*提单号：</td>
          <td  id="bl_id"	class="ltitle"></td>
		   </tr >

		   <tr>
		   <td		class="rtitle" width=95>箱号.：</td>
          <td id="box_id" 	class="ltitle">        
          </td>
		   <td		class="rtitle" width=95>封号：</td>
          <td><input  id="box_leadSealing"	type="text" class="linput">   
          </td>
		  <td		class="rtitle" width=95>箱型：</td>
          <td id="box_type" 	class="ltitle">
          </td>
		  </tr>
		   <tr>
		   <td		class="rtitle" width=95>发货人：</td>
          <td  id="sender"	class="ltitle">       
          </td>
		   <td		class="rtitle" width=95>收货人：</td>
          <td  id="receiver"	class="ltitle">        
          </td>
		  <td		class="rtitle" width=95>代理：</td>
          <td  	class="ltitle">哈工大货代</td>
		  </tr>

	 	  
          
  
             <tr >
			 <td		class="rtitle" width=95>船名：</td>
			
          <td id="ship_name" 	class="ltitle">      
          </td> 
          <td		class="rtitle" width=95>船次：</td>
          <td  id="scd_id"	class="ltitle">  
          </td>
		  <td		class="rtitle" width=95>装货港：</td>
          <td  id="departure"	class="ltitle">
          </td>
		   </tr >
		  
		   <tr >
			 <td		class="rtitle" width=95>卸货港：</td>
			
          <td  id="destination1"	class="ltitle">
          </td> 
          <td		class="rtitle" width=95>目的港：</td>
          <td  id="destination2"	class="ltitle">
          </td>
		  <td		class="rtitle" width=95>交货地点：</td>
          <td  id="receive_loc"	class="ltitle">
          </td>
		   </tr >
		  
		   <tr>
		    <td		class="rtitle" width=95>等级：</td>
			
          <td  id="danger_class"	class="ltitle">
          </td> 
          <td		class="rtitle" width=95>危规页码：</td>
          <td  	class="ltitle">      
          </td>
		  <td		class="rtitle" width=95>联合国编号：</td>
          <td  id="unid"	class="ltitle">
          </td>
		   </tr >
		    <tr >
			 <td		class="rtitle" width=95>装货地：</td>
			
          <td  id="load_loc"	class="ltitle">
          </td> 
          <td		class="rtitle" width=95>货物种类：</td>
          <td id="goods_type" 	class="ltitle">
          </td>
		  <td		class="rtitle" width=95>冷藏程度：</td>
          <td id="goods_temp" 	class="ltitle">
          </td>
		   </tr >
		 
  			<tr>
  				<td class="rtitle" width="95">装箱人姓名：</td>
  				<td id="loader_name" class="ltitle"></td>
  				<td class="rtitle" width="95">装箱人电话：</td>
  				<td id="loader_tel" class="ltitle"></td>
  				<td class="rtitle" width="95">装箱人签章：</td>
  				<td id="loader_sign" class="ltitle"></td>
  			</tr>
  			<tr>
  				<td class="rtitle" width="95">驾驶员签章：</td>
  				<td id="driver_sign" class="ltitle"></td>
  				<td class="rtitle" width="95">车号：</td>
  				<td id="truck_no" class="ltitle"></td>
  			</tr>
	  <tr>
          <td class="rtitle">审批状态：</td>
          <td class="ltitle">  
          
			未提交</td>
          <td class="rtitle">审批流程：</td><td class="ltitle" colspan="3">        
          <input name="Check_flow_id"   type="hidden" value="StoreStart001" size="10" class="linputrl">
          <input name="Check_flow_name" type="text"   value="缮制" size="20" class="linputr">
          <input name="Audit_state_flag" type="hidden" value="S" size="10" class="linputrl">
          </td>
      </tr>
	  
	</table>

<table width="760">
    <tr>
      <td class="rtitle">
	   
	    
	  是否通过：
			<select name = "Audit_flag">
				<option value="">&nbsp;</option>
				<option value="Y">通过</option>
				<option value="N">不通过</option>
			</select>
      审核意见：<input name="Audit_option" size=20  class="linput">
	  
	    <font face="Webdings" class="redcolor">4</font><a href="javascript:update_container_load()">更新</a>
      <font face="Webdings" class="redcolor">4</font><a href="javascript:myClose()">关闭</a>
      
      
      <font face="Webdings" class="redcolor">4</font><a href="#" onclick="javascript:go_back()">返回</a>
      
	  </td>
	</tr>
</table>

</center>

</body>
</html>


